-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a way for Shape to preserve user preferred state #1044
base: develop
Are you sure you want to change the base?
Conversation
Could you describe the use case and how this is a problem ? |
The meshes are meant to be automatically hidden/shown when they are within a certain range of the angle where the mesh was created. The meshes are only valid for a certain projection. see
This is perhaps not behaving as you wish ? |
This is an attempt to fix following bug:
After the data collection is finished, the mesh will be un-hidden. The behavior we want is that meshes explicitly hidden by the user are never automatically un-hidden. |
Ah, we should perhaps then add an option to disable the auto hide/show option ? |
I think the current behavior is fine. The users so far have not complained about meshes getting hidden during data collections, scans, etc. It's only the part where all meshes become visible after the scan is finished that annoys users. Also, here is the MXCuBE-web part of the bug fix: mxcube/mxcubeweb#1460 |
I see, is that because all the meshes where created at the same angle or for some other reason. Why is all meshes shown when the collection finishes ? |
14fffb8
to
48d2c47
Compare
Yes, it is a common usage scenario at MicroMAX right now. Users use large chips to collect data. They draw a number of mesh grids at the same angle, as the chip don't rotate. The reason all mesh grids are made visible, is because the code that auto-hides grids does something like this:
Thus the information if a grids was hidden by the user is lost. When code that un-hides grids runs, it shows all grids with correct angle. |
I see, I'm hesitant on adding a
The drawing of the shapes on the canvas is not performed when the goniometer motors are moving but updated when the state changes to ready. Or did I perhaps leave something out ? I guess in that case what is causing you this issue is that the state gets changed on rotation, maybe simply adding a option that disables the code above would be enough ?. You could perhaps try to comment out that section and see if it helps ? |
You are right, the I've talked with @elmjag and the desired functionality looks like this:
This would require to store the user's preference somewhere, e.g., in the |
The problem I see with this feature is that it clashes with the idea of auto hiding. The user would after some time not know which meshes are not being shown because they are auto hidden or explicitly hidden. I guess in that case it should be more evident in the grid list why a grid is hidden. I somehow thing that this might lead to some confusion, thats why I'm a bit hesitant. It would perhaps be possible to always display a dashed outline of hidden grids or highlight them in the grid table, not sure what would be the best. |
567bc52
to
fae349b
Compare
I think you're right there; I've made some changes on the UI part so that the user-hidden grids appear with a darker background. I've also pushed some changes to this repository. I've updated the functions that redraw the shapes, to be able to persist the |
fae349b
to
b6e2742
Compare
The PR introduces
user_state
attribute that will be set by the web app.Previously, when the user set grid to be hidden or visible, it set
state
attribute ofGrid
class as eitherHIDDEN
orSAVED
.The same attribute was being changed as a result of diffractometer's motors having their state changed, like in the code below:
https://github.com/mxcube/mxcubecore/blob/d9668efbc0ea7c2d66536d9e6224beba212a4c40/mxcubecore/HardwareObjects/SampleView.py#L35C1-L56C35
The new
user_state
attribute is being intended to be able to be modified by the web app by listening to events such asphaseChanged
orcollectOscillationFinished
in order to restore the state that user wants to see, after these operations are done.